package com.blog.controller;

import com.blog.dto.GuestContent;
import com.blog.dto.Result;

import com.blog.service.GuestbookService;
import org.springframework.web.bind.annotation.*;


import javax.annotation.Resource;


@RestController
@RequestMapping("/public/guestbook")
public class GuestbookController {
    @Resource
    private GuestbookService guestbookService;
    @PostMapping("/add")
    public Result addGuestbook(@RequestBody GuestContent guestbook) {
        guestbookService.addguestbook(guestbook);
        return Result.ok();
    }

    @GetMapping("/list")
    public Result getGuestbook() {
        return Result.ok(guestbookService.getguestbook());
    }
}
